473,473 Members | 2,195 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How can I make the page ignore the mousedown event?

I want the page to completely ignore all mouse clicks. I can create
the onmouseclick event and return false, but that only disables
certain types of things. I can still, for example, click in a text box
and then type something or change the selection in a dropdown list. I
tried returning false in the onmousedown event, but that didn't do the
trick. I'd rather not have to disabled all the controls on the page.
Any ideas?
Thanks in advance,
John
Jul 23 '05 #1
10 2170
I don't have a ready answer for the question, but I am curious why you'd
want to do such a thing?
"john" <jo********@yahoo.com> wrote in message
news:29**************************@posting.google.c om...
I want the page to completely ignore all mouse clicks. I can create
the onmouseclick event and return false, but that only disables
certain types of things. I can still, for example, click in a text box
and then type something or change the selection in a dropdown list. I
tried returning false in the onmousedown event, but that didn't do the
trick. I'd rather not have to disabled all the controls on the page.
Any ideas?
Thanks in advance,
John

Jul 23 '05 #2
On 19 Apr 2004 11:24:33 -0700, john <jo********@yahoo.com> wrote:
I want the page to completely ignore all mouse clicks. I can create
the onmouseclick event and return false, but that only disables
certain types of things. I can still, for example, click in a text box
and then type something or change the selection in a dropdown list. I
tried returning false in the onmousedown event, but that didn't do the
trick. I'd rather not have to disabled all the controls on the page.
Any ideas?


Read the thread, "Cancel click event an a page" [sic], posted by Paolo
Mancini earlier today. My response to that question is the same.

Author: pa******@yahoo.it (Paolo Mancini)
Subject: Cancel click event an a page
Date: 19 Apr 2004 09:36:50 -0700
Msg-ID: <46**************************@posting.google.com >

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 23 '05 #3
In article <29**************************@posting.google.com >,
jo********@yahoo.com enlightened us with...
I want the page to completely ignore all mouse clicks.
Bad Idea (tm). I use my mouse for page navigation. Many disabled people
do, too. You ignore all clicks, you disallow mouse navigation. Not good.
I can create
the onmouseclick event and return false, but that only disables
certain types of things. I can still, for example, click in a text box
and then type something or change the selection in a dropdown list. I
tried returning false in the onmousedown event, but that didn't do the
trick. I'd rather not have to disabled all the controls on the page.


Why would they ALL need disabled? If that's the case, just don't allow
form submittal.

If a few need "disabled", but you want them submitted, there's several
solutions to that, depending on what your needs really are. None of them
involve disabling clicking on the main document.
--
--
~kaeli~
Press any key...NO, NO, NO, NOT THAT ONE!!!!!!
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #4
Thanks for the responses. It seems that there's no easy way to do what
I want to do. Since two of you have asked why I would want do such a
thing, here is the reason: When the user has clicked on a button that
is causing the browser to post back to the server, it could take a
little while for the new page to show up. So in the mean time, I want
to change the cursor to an hourglass and not allow the user to do
anything with any of the controls on the page.
Jul 23 '05 #5
If THAT's all you want to do, then here's a possible solution: have a
message inside some sort of container that says "Please Wait..." or somesuch
that is adjacent to the Submit button and is hidden when the page loads.
When you click "submit", hide the button, show the message, and if you like
change the document.body.style.cursor = 'wait' (warning: NOT cross-browser).
You'll probably have to replace the Submit button with a "button" button,
with an onClick event handler that toggles visibility and then
form.submit()'s. If you really want to walk down the verbose road, loop all
of the form elements and set disabled=true (warning: NOT cross-browser).
YMMV.

Here's the deal, John: once the user clicks the button and the form has been
submitted, the user can do whatever they want to the page and they're not
going to change what was sent: it's already gone. You can take the submit
button away to prevent them from submitting again, which is what it sounds
like you really want to do anyway. We do this sort of thing all the time in
our own web applications.

- Wm

--
William Morris
Semster, Seamlyne reProductions
Visit our website, http://www.seamlyne.com, for the most comfortable
historically inspired clothing you can buy!
"john" <jo********@yahoo.com> wrote in message
news:29**************************@posting.google.c om...
Thanks for the responses. It seems that there's no easy way to do what
I want to do. Since two of you have asked why I would want do such a
thing, here is the reason: When the user has clicked on a button that
is causing the browser to post back to the server, it could take a
little while for the new page to show up. So in the mean time, I want
to change the cursor to an hourglass and not allow the user to do
anything with any of the controls on the page.

Jul 23 '05 #6
john wrote:
Thanks for the responses. It seems that there's no easy way to do what
I want to do. Since two of you have asked why I would want do such a
thing, here is the reason: When the user has clicked on a button that
is causing the browser to post back to the server, it could take a
little while for the new page to show up. So in the mean time, I want
to change the cursor to an hourglass and not allow the user to do
anything with any of the controls on the page.


Blur the controls (using blur()) and do not allow for form submittal.

It is a lot better than making the browser look like it is froze.

Brian

Jul 23 '05 #7
In article <29**************************@posting.google.com >,
jo********@yahoo.com enlightened us with...
Thanks for the responses. It seems that there's no easy way to do what
I want to do. Since two of you have asked why I would want do such a
thing, here is the reason: When the user has clicked on a button that
is causing the browser to post back to the server, it could take a
little while for the new page to show up. So in the mean time, I want
to change the cursor to an hourglass and not allow the user to do
anything with any of the controls on the page.


That's a very bad idea. I tried something similar. When the server had
issues and the page timed out, the user had no way to resubmit the form.
They had to refresh the page, thereby losing any changes they made.

Better to just pop up an alert or put in text on the page indicating
that processing has started. That's what I ended up with.

--
--
~kaeli~
Why do they lock gas station bathrooms? Are they afraid
someone will clean them?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #8
On Tue, 20 Apr 2004 11:14:44 -0500, kaeli <ti******@NOSPAM.comcast.net>
wrote:
In article <29**************************@posting.google.com >,
jo********@yahoo.com enlightened us with...
[disable controls and display hourglass]
That's a very bad idea. I tried something similar. When the server had
issues and the page timed out, the user had no way to resubmit the form.
They had to refresh the page, thereby losing any changes they made.

Better to just pop up an alert or put in text on the page indicating
that processing has started. That's what I ended up with.


Assuming that the delay is due to server processing and returning the
results, not sending the data, would it be feasible to return a small
intermediate page that would forward the user to the results page? As most
browsers retain form values, a user could still use the Back button to
return to the first page if the connection fails for some reason. The only
disadvantage I see at the moment is that temporary storage is needed on
the server to store the data during the transition.

You have more server-side knowledge than I do. What do you think?

Just a thought,
Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 23 '05 #9
On Tue, 20 Apr 2004 08:37:14 -0500, William Morris
<ne***************************@seamlyne.com> wrote:
If THAT's all you want to do, then here's a possible solution: have a
message inside some sort of container that says "Please Wait..." or
somesuch that is adjacent to the Submit button and is hidden when the
page loads.
It would be more reliable to show a permanent message above the submit
button that informs the user that the results may take some time to return
and that the user should be patient.
When you click "submit", hide the button, show the message, and if
you like change the document.body.style.cursor = 'wait' (warning: NOT
cross-browser). You'll probably have to replace the Submit button with a
"button" button, with an onClick event handler that toggles visibility
and then form.submit()'s.
An interesting idea. However, it might be more easily accomplished by
something like

function toggleSubmit( button ) {
button.value = ( 'Send' == button.value ) ?
'Please wait...' : 'Send';
}

function validate( form ) {
// ...
return( form.elements[ 'send' ].value != 'Send' );
}

<form ... onsubmit="return validate(this)">
<input id="send" type="submit" onclick="toggleSubmit(this)"
value="Send">
If you really want to walk down the verbose road, loop all of the form
elements and set disabled=true (warning: NOT cross-browser).
YMMV.


However, you would have to do that *after* the form was sent, otherwise
nothing would be transmitted!

[snip]

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 23 '05 #10
In article <op**************@news-text.blueyonder.co.uk>,
M.******@blueyonder.co.invalid enlightened us with...

Assuming that the delay is due to server processing and returning the
results, not sending the data, would it be feasible to return a small
intermediate page that would forward the user to the results page?


Feasible? Sure.
Worth the effort? That's very subjective, and I decided it was not. If
it were something that happened often and caused problems, I might be
more inclined, but it was only one report out of many that took so long
to run. I usually manage to make my reports run fast enough so it isn't
an issue. This was a big one requested by a user and only a few people
use it.
I might also decide it was worth if effort if it were an internet
application. Mine is intranet and I know my users.

YMMV.
--
--
~kaeli~
He's your God, they're your rules - you burn in Hell.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Deborah V. Gardner | last post by:
I have a list box and would like to point to an item and have a textbox popup referencing a column in the list box. On the list box's MouseDown event I have the following Dim strFullText ...
2
by: JJ | last post by:
Hi All, I need to create a MouseDown event for a picture box . Am I doing the following right? pictureBox.MouseDown += new System.WinForms.MouseEventHandler(pictureBox_MouseDown) Then
1
by: GregM | last post by:
I have a read only datagrid that is designed to coordinate itself with textboxes. When the user clicks on a row in the datagrid, detailed data for that row is displayed for editing in the...
7
by: Scott Mackay | last post by:
Hi, I'm using visual studio dotnet 2002 programming in vb can anyone tell me how I can handle the mousedown event for pictureboxes I create dynamically at runtime? I've tried setting the...
4
by: rsmith | last post by:
How can I capture the MouseDown event on a Label ? I entered thr following code and got a " cannot handle Event 'MouseDown' because they do not have the same signature." Private Sub...
1
by: Merlin | last post by:
I have created a UserControl which has a label; what I wish to do is place this UserControl on a form and then trap the Mouse Down event, whenever someone clicks my control. My problem is that the...
2
by: Rob | last post by:
How can I fix the following warning warning BC40004: sub 'MouseDown' conflicts with event 'MouseDown' in the base class 'Control' and so should be declared 'Shadows'. This warning appears...
1
by: Alan | last post by:
i have a form with a label on it Private Sub Label1_mousedown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseDown ' do stuff End Sub ...
2
by: bretth | last post by:
In a VB.Net Windows Forms application, I have a user control that handles mouse events. Another section of code programmatically adds a label to the control. I would like label to ignore all...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.